// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   welfare.java

package com.oa.hr;

import com.oa.database.DataConn;
import com.oa.database.QueryData;
import java.io.PrintStream;
import java.sql.*;

public class welfare
{

    private DataConn dataConn;

    public welfare()
    {
        dataConn = null;
    }

    public welfare(DataConn dataConn)
    {
        this.dataConn = null;
        this.dataConn = dataConn;
    }

    public String getDWBH()
    {
        String sTemp = "";
        try
        {
            DataConn dataConn = new DataConn();
            QueryData queryData = new QueryData(dataConn);
            String sTable = "OA_YG_BX_CS";
            String sField = "DWBH";
            String sCondition = "1=1";
            queryData.setMultRecordSet(sTable, sField, sCondition);
            ResultSet rs = queryData.getResultSet();
            if(rs.next())
                sTemp = rs.getString("DWBH");
        }
        catch(SQLException e)
        {
            sTemp = "";
        }
        return sTemp;
    }

    public float getWelfare(int JBXXID, int FLID, int year, int month)
    {
        ResultSet rs = null;
        String sqlStr = null;
        PreparedStatement pstmt = null;
        float welfare = 0.0F;
        try
        {
            sqlStr = "select GRJE from OA_YG_BX_JNMX where JBXXID = ? and MXLX = ? and JNNF = ? and JNYF= ?";
            pstmt = dataConn.getConnection().prepareStatement(sqlStr);
            pstmt.setInt(1, JBXXID);
            pstmt.setInt(2, FLID);
            pstmt.setInt(3, year);
            pstmt.setInt(4, month);
            rs = pstmt.executeQuery();
            if(rs.next())
                welfare = rs.getFloat(1);
            rs.close();
        }
        catch(Exception exception) { }
        return welfare;
    }

    public float getWelfare(int JBXXID, int FLID)
    {
        ResultSet rs = null;
        String sqlStr = null;
        PreparedStatement pstmt = null;
        float welfare = 0.0F;
        try
        {
            sqlStr = "select GRJE from OA_YG_BX_JNMX where JBXXID = ? and MXLX = ?  order by JNNF,JNYF desc";
            pstmt = dataConn.getConnection().prepareStatement(sqlStr);
            pstmt.setInt(1, JBXXID);
            pstmt.setInt(2, FLID);
            rs = pstmt.executeQuery();
            if(rs.next())
                welfare = rs.getFloat(1);
            rs.close();
        }
        catch(Exception exception) { }
        return welfare;
    }

    public static void main(String args[])
    {
        DataConn conn = new DataConn();
        welfare wf = new welfare(conn);
        System.out.println(wf.getWelfare(107, 0));
        wf.dataConn.close();
    }
}
